package com.example.demo.common.generator.template;

public enum Templates {

    TEMPLATE_CONTROLLER("package ${generator.modulePath}.controller;\r\n"
            + "\r\n"
            + "import org.springframework.beans.factory.annotation.Autowired;\r\n"
            + "import org.springframework.stereotype.Controller;\r\n"
            + "\r\n"
            + "import ${generator.modulePath}.service.impl.${generator.tableName}ServiceImpl;\r\n"
            + "\r\n"
            + "@Controller\r\n"
            + "public class ${generator.tableName}Controller {\r\n"
            + "\r\n"
            + "    @Autowired\r\n"
            + "    ${generator.tableName}ServiceImpl ${generator.tableName}ServiceImpl;\r\n"
            + "\r\n"
            + "\r\n"
            + "}\r\n"
            + ""),
    TEMPLATE_REST_CONRTOLLER("package ${generator.modulePath}.controller;\r\n"
            + "\r\n"
            + "import org.springframework.beans.factory.annotation.Autowired;\r\n"
            + "import org.springframework.web.bind.annotation.RestController;\r\n"
            + "\r\n"
            + "import ${generator.modulePath}.service.impl.${generator.tableName}ServiceImpl;\r\n"
            + "\r\n"
            + "@RestController\r\n"
            + "public class ${generator.tableName}Controller{\r\n"
            + "\r\n"
            + "    @Autowired \r\n"
            + "    ${generator.tableName}ServiceImpl ${generator.tableName}ServiceImpl;\r\n"
            + "\r\n"
            + "\r\n"
            + "}\r\n"
            + ""),
    TEMPLATE_SERVICE("package ${generator.modulePath}.service;\r\n"
            + "\r\n"
            + "public interface ${generator.tableName}Service {\r\n"
            + "\r\n"
            + "\r\n"
            + "}\r\n"
            + ""),
    TEMPLATE_SERVICE_IMPL("package ${generator.modulePath}.service.impl;\r\n"
            + "\r\n"
            + "import org.springframework.beans.factory.annotation.Autowired;\r\n"
            + "import org.springframework.stereotype.Service;\r\n"
            + "\r\n"
            + "import com.example.demo.order.service.OrderService;\r\n"
            + "\r\n"
            + "import ${generator.modulePath}.dao.${generator.tableName}Mapper;\r\n"
            + "\r\n"
            + "@Service\r\n"
            + "public class ${generator.tableName}ServiceImpl implements ${generator.tableName}Service{\r\n"
            + "\r\n"
            + "    @Autowired\r\n"
            + "    private ${generator.tableName}Mapper ${tableNameField}Mapper;\r\n"
            + "\r\n"
            + "}\r\n"
            + "");

    String value;

    Templates(String value) {
        this.value = value;
    }

    public String getValue() {
        return value;
    }


}
